package com.cskaoyan.javase._1interface._3exercise;

/**
 * 教练（Coach）和运动员（Sportsman）案例
 * 小试牛刀请用所学知识分析：这个案例中有哪些抽象类，哪些接口，哪些具体类。
 *
 * 现在有乒乓球运动员和篮球运动员，乒乓球教练和篮球教练。为了能够出国交流，跟乒乓球相关的人员都需要学习英语。
 *
 * 抽象类: 抽象的运动员类和抽象的教练类,抽象的人类
 * 具体类: 乒乓球运动员和篮球运动员,乒乓球教练和篮球教练
 * 接口: 学习英语
 *
 * @since 14:49
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Demo {
    public static void main(String[] args) {
        BasePerson bp = new TableTennisCoach();
        BaseCoach bc = new TableTennisCoach();
        ILearning i = new TableTennisCoach();
        TableTennisCoach ttc = new TableTennisCoach();
    }
}

abstract class BasePerson {
    String name;
    int age;

    public abstract void eat();
}

abstract class BaseSportsman extends BasePerson {
    double salary;

    public abstract void exercise();
}

abstract class BaseCoach extends BasePerson {
    double bonus;

    public abstract void teach();
}

interface ILearning {
    void learningEnglish();
}

class TableTennisCoach extends BaseCoach implements ILearning {

    @Override
    public void eat() {
        System.out.println("我吃点海参!");
    }

    @Override
    public void teach() {
        System.out.println("我教🏓的!");
    }

    @Override
    public void learningEnglish() {
        System.out.println("在宾馆学英语!");
    }
}

class BasketballSportsman extends BaseSportsman {

    @Override
    public void eat() {
        System.out.println("我得吃点好的!");
    }

    @Override
    public void exercise() {
        System.out.println("我坚持训练打篮球!");
    }
}